﻿// JScript 文件
//var ajax = new AJAX();ajax.setcharset("utf-8");
//function clearCache(){
//	set($("upcacheresult"),'加载中...')
//	ajax.get(
//		"admin_ajax.aspx?action=restartcache", 
//		function(obj) {
//			if(obj.responseText == 'ok'){
//				set($("upcacheresult"),'缓存更新成功')
//			}else{
//				set($("upcacheresult"),'缓存更新失败')
//			}
//		}
//	);	
//}]
function clearCache()
{
    ajax_get("DotNetMain.aspx?action=restartcache","",function(msg){
    if(msg=="1")
    {
        $("#upcacheresult").empty().append('缓存更新成功');
    }
    else
    {
        $("#upcacheresult").empty().append('缓存更新失败');
    }
 })
}
/**
 * 使用ajax提交数据
 */
function ajax_post(the_url,the_param,succ_callback){
	$.ajax({
		type:'POST',
		url:the_url,
		data:the_param,
		cache:false,
		success:succ_callback,
		error:function(html){
			alert("提交数据失败，代码:" +html.status+ "，请稍候再试");
		}
	});
}
function ajax_get(the_url,the_param,succ_callback){
	$.ajax({
		type:'get',
		url:the_url,
		data:the_param,
		success:succ_callback,
		error:function(html){
			alert("提交数据失败，代码:" +html.status+ "，请稍候再试");
		}
	});
}

function ajax_call(the_url,the_param){
	$.ajax({
		type:'POST',
		url:the_url,
		data:the_param,
		success:function(html){alert(html);},
		error:function(html){
			alert("提交数据失败，代码:" +html.status+ "，请稍候再试");
		}
	});
}
//给url地址加时间戳,骗过浏览器,不读取缓存   
function convertURL(url){   
    //获取时间戳   
    var timstamp = (new Date()).valueOf();   
    //将时间戳信息拼接到url上   
    if(url.indexOf("?")>=0){   
        url = url +"&t=" + timstamp;   
    }else{   
        url = url +"?t=" + timstamp;   
    }   
    return url;   
} 